Object Detection Demo

Welcome to the object detection inference walkthrough! This notebook will walk you step by step through the process of using a pre-trained model to detect objects in an image. Make sure to follow the installation instructions before you start.

Imports

In [12]:

Env setup

In [13]:

Object detection imports

Here are the imports from the object detection module.

In [14]:

Model preparation

Variables

Any model exported using the export_inference_graph.py tool can be loaded here simply by changing PATH_TO_CKPT to point to a new .pb file.

By default we use an "SSD with Mobilenet" model here. See the detection model zoo for a list of other models that can be run out-of-the-box with varying speeds and accuracies.

In [15]:

Download Model

In [ ]:

Load a (frozen) Tensorflow model into memory.

In [16]:

Loading label map

Label maps map indices to category names, so that when our convolution network predicts 5, we know that this corresponds to airplane. Here we use internal utility functions, but anything that returns a dictionary mapping integers to appropriate string labels would be fine

In [17]:

Helper code

In [18]:

Detection

In [27]:
In [28]:
In [ ]: